package com.rectcircle.scalatrateset.controller

import com.rectcircle.scalatrateset.db.{BookDb, DatabaseSessionSupport}
import org.json4s.{DefaultFormats, Formats}
import org.scalatra.json.JacksonJsonSupport

/**
  * @author Rectcircle
  *         createTime 2017/1/7
  */
class DbController extends ScalatratestStack with DatabaseSessionSupport  with JacksonJsonSupport{
	
	protected implicit lazy val jsonFormats: Formats = DefaultFormats
	
	before() {
		contentType = formats("json")
	}
	
	get("/allBooks"){
		BookDb.getAll
	}
}
